//    Copyright (C) Kherty.  All rights reserved.



using System;
using System.Diagnostics.Contracts;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using OpenLS.Drawing;

namespace OpenLS.Chart.UI
{
    ///<summary>
    /// Resource dictionary for displaying chart titles
    ///</summary>
    sealed partial class TitleResources
    {
        public TitleResources()
        {
            InitializeComponent();
        }

       // private static TitleResources _singleton = new TitleResources();

        private void onDelete(object sender, ExecutedRoutedEventArgs e)
        {
            var axis = AxisElement.GetAxis((DependencyObject) sender);
            if (axis != null)
            {
                axis.Title = null;
                return;
            }
            var chartArea = ChartElement.GetChartArea((DependencyObject) sender);
            if (chartArea != null)
            {
                chartArea.Title = null;
                return;
            }

        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var tb = (RichTextBox)sender;
            tb.Document = (FlowDocument)tb.DataContext;
        }

        private void myrtb_LostFocus(object sender, RoutedEventArgs e)
        {
            var tb = (RichTextBox) sender;
            TextBody textBody = (TextBody) tb.DataContext;
            
        }

        private void Myrtb_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            var tb = (RichTextBox)sender;
            TextBody textBody = (TextBody)tb.DataContext;
           
        }
    }
}
